import json
from sdk.client import Client
from sdk.common import BuildClient

class DeviceLog:
    def __init__(self, client):
        self.client = client
        
    def online_log(self, req):
        get_params = {
            "device_num": req.device_num,
            "page": req.page_model.page,
            "limit": req.page_model.limit
        }
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/log/online_log", get_params)
